[action] [PR:175] Changing the wildcard matching logic for client cert common names#178
Merged
mssonicbld merged 1 commit intosonic-net:202505from Jan 16, 2026
Merged
Conversation
Microsoft ADO ID: 36341347 PR sonic-net#168 added support for wildcard matching between client cert CNs and trusted CNs. This PR changes the wildcard matching logic based on a discussion with @qiluo-msft and @prsunny. Changes: 1. Wildcard patterns starting with `*` but not `*.` (e.g., `*example.sonic`) are no longer valid. These patterns are skipped during the matching. 2. `*.` is not a valid trusted CN and will be skipped if present. 3. `*` must match one or more characters. For example, `*.example.sonic` will not match `.example.sonic`. **Note 1:** Comparison is always case sensitive, but `*` can match both upper and lower case characters. For example, `*.example.sonic` matches `TEST.example.sonic`, but it does not match `TEST.EXAMPLE.SONIC`. **Note 2:** Multi-level subdomain matching is allowed for wildcard patterns. For example, `*.example.sonic` matches `test.example.sonic`, `sub.test.example.sonic`, `one.sub.test.example.sonic`, and so on.
Author
|
Original PR: #175 |
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Microsoft ADO ID: 36341347
PR #168 added support for wildcard matching between client cert CNs and trusted CNs. This PR changes the wildcard matching logic based on a discussion with @qiluo-msft and @prsunny.
Changes:
*but not*.(e.g.,*example.sonic) are no longer valid. These patterns are skipped during the matching.*.is not a valid trusted CN and will be skipped if present.*must match one or more characters. For example,*.example.sonicwill not match.example.sonic.Note 1: Comparison is always case sensitive, but
*can match both upper and lower case characters. For example,*.example.sonicmatchesTEST.example.sonic, but it does not matchTEST.EXAMPLE.SONIC.Note 2: Multi-level subdomain matching is allowed for wildcard patterns. For example,
*.example.sonicmatchestest.example.sonic,sub.test.example.sonic,one.sub.test.example.sonic, and so on.